import cn.pfz.Service.*;
import cn.pfz.domain.*;
import cn.pfz.mapper.DepartmentMapper;
import cn.pfz.mapper.EmployeeMapper;
import cn.pfz.mapper.EmployeeRoleMapper;
import cn.pfz.mapper.RoleMapper;
import cn.pfz.query.EmployeeQuery;
import cn.pfz.query.QueryObject;
import cn.pfz.query.SystemDictionaryItemQueryObject;
import cn.pfz.query.appointmentQuery;
import freemarker.template.Configuration;
import freemarker.template.Template;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:ApplicationContext.xml")
public class asd {
    
    @Autowired
    private DepartmentMapper departmentMapper;
    @Autowired
    private IEmployeeRoleSerives employeeRoleMapper;
    @Autowired
    private IEmployeeSerives employeeMapper;
    @Autowired
    private IRoleSerives roleMapper;
    @Autowired
    private IPermissionSerives iPermissionSerives;
    @Autowired
    private ISystemDictionaryItemSerives systemDictionaryItemSerives;
    
    @Autowired
    private IBusinessService businessService;
    
    @Autowired
    private IAppointmentMapperService appointmentMapperService;
    
    
    @Test
    public void fun() throws Exception {
        Configuration configuration = new Configuration(Configuration.VERSION_2_3_0);
//加载模板
        configuration.setDirectoryForTemplateLoading(new File("templates"));
        configuration.setDefaultEncoding("UTF-8");
//        封装数据
        HashMap map = new HashMap();
        map.put("user", "dasdas");
//获取模板文
        Template template = configuration.getTemplate("text.ftl");
        //设置输入的新文件
        Writer out = new OutputStreamWriter(new FileOutputStream("text.html"));
        template.process(map, out);
        out.flush();
        out.close();
    }
    

  
    
 
    

}
